--- import { getCollection } from 'astro:content'; import { shouldShowContent } from '@/utils/markdown'; import { siteConfig } from '@/config'; import DocumentationLayout from '@/layouts/DocumentationLayout.astro'; export async function getStaticPaths() { // If docs are disabled, don't generate any paths if (!siteConfig.optionalContentTypes.docs) { return []; } const docs = await getCollection('docs'); const isDev = import.meta.env.DEV; const paths = []; // Generate paths for all docs - each .md file is a separate doc for (const doc of docs) { if (!shouldShowContent(doc, isDev)) continue; // Use the full doc ID as the slug (e.g., "api" or "sourcetree-and-git-setup") const slug = doc.id; paths.push({ params: { slug: slug }, props: { documentation: doc } }); } return paths; } const { documentation } = Astro.props; if (!documentation) { return Astro.redirect('/docs/', 404); } ---